<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePaymentTable extends Migration
{
    /**
     * 支付管理
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('payment', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->index('user_id')->comment('用户id');
            $table->timestamps();
            $table->string('account')->comment('账号');
            $table->string('name')->comment('姓名');
            $table->string('bank_name')->default('')->comment('银行名称');
            $table->string('qrcode')->default('')->comment('二维码');
            $table->unsignedTinyInteger('type')->default(0)->comment('支付方式：0为支付宝、1为微信');
            $table->unsignedTinyInteger('is_default')->default(0)->comment('是否设为默认：0为不设置、1为设置默认');
            $table->charset = 'utf8';
            $table->collation = 'utf8_unicode_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('payment');
    }
}
